package com.learn.annotation;

import com.learn.annotation.services.IHelloWordService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Configuration
@ComponentScan
@EnableAspectJAutoProxy
public class AnnotationApplication {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AnnotationApplication.class);

        IHelloWordService helloWordService = (IHelloWordService) context.getBean("helloWordService");
        helloWordService.save("lyf");
        System.out.println("===============分割线==============");
        helloWordService.query("867346398");

        context.destroy();
    }
}
